
 <!DOCTYPE HTML>
<html lang="chinese">
<head>
  <meta charset="UTF-8">

  <title>hexo | liyang&#39;s blog</title>

    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=3, minimum-scale=1">
    
    <meta name="author" content="Screenshot 2015">
    
    <meta name="description" itemprop="description" content="用于个人笔记">
    
    
    
    <meta name="twitter:card" content="summary" />
    <meta name="twitter:site" content="564845354" />
    <meta name="twitter:title" content="hexo | liyang&#39;s blog" />
      
        <meta name="twitter:description" content="用于个人笔记" />
      
    
    
    <link rel="alternate" href="/atom.xml" title="liyang&#39;s blog" type="application/atom+xml">
    
    
    <link rel="icon" href="/img/favicon.ico">
    
    
    <link rel="apple-touch-icon" href="/http://7viklp.com1.z0.glb.clouddn.com/yilan/img/blog/pacman.jpg">
    <link rel="apple-touch-icon-precomposed" href="/http://7viklp.com1.z0.glb.clouddn.com/yilan/img/blog/pacman.jpg">
    
    <link rel="stylesheet" href="/css/style.css">
</head>

  <body>
    <header>
      <div>
		
			<div id="imglogo">
				<a href="/"><img src="/img/logo.svg" alt="liyang&#39;s blog" title="liyang&#39;s blog"/></a>
			</div>
			
			<div id="textlogo">
				<h1 class="site-name"><a href="/" title="liyang&#39;s blog">liyang&#39;s blog</a></h1>
				<h2 class="blog-motto">Stay hungry,stay foolish.</h2>
			</div>
			<div class="navbar"><a class="navbutton navmobile" href="#" title="Menu">
			</a></div>
			<nav class="animated">
				<ul>
					
						<li><a href="/">Home</a></li>
					
						<li><a href="/archives">Archives</a></li>
					
						<li><a href="/about">About</a></li>
					
					<li>
					
											<form class="search" action="/search/index.html" method="get" accept-charset="utf-8">
											<label>Search</label>
											<input type="text" class="st-default-search-input" maxlength="20" placeholder="Search" />
											</form>
					
					</li>
				</ul>
			</nav>			
			<script type="text/javascript">
			  (function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){
			  (w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
			  e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
			  })(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st');

			  _st('install','ThbyuUMiwzLDsmVUEvye','2.0.0');
			</script>
</div>

    </header>
    <div id="container">
      <div id="main" class="post" itemscope itemprop="blogPost">
	<article itemprop="articleBody"> 
		<header class="article-info clearfix">
  <h1 itemprop="name">
    
      <a href="/2016/11/09/hexo/" title="hexo" itemprop="url">hexo</a>
  </h1>
  <p class="article-author">By
    
      <a href="http://buildlove.github.io" title="Screenshot 2015">Screenshot 2015</a>
    </p>
  <p class="article-time">
    <time datetime="2016-11-09T02:03:40.000Z" itemprop="datePublished">2016-11-09</time>
    Updated:<time datetime="2016-11-09T03:27:09.000Z" itemprop="dateModified">2016-11-09</time>
    
  </p>
</header>
	<div class="article-content">
		
		
		<div id="toc" class="toc-article">
			<strong class="toc-title">Contents</strong>
		<ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#学习链接"><span class="toc-number">1.</span> <span class="toc-text">学习链接</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#常见错误"><span class="toc-number">2.</span> <span class="toc-text">常见错误</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#git-deploy上传时提示仓库不存在"><span class="toc-number">2.1.</span> <span class="toc-text">git deploy上传时提示仓库不存在</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Error-Cannot-find-module-‘-build-Release-DTraceProviderBindings’"><span class="toc-number">2.2.</span> <span class="toc-text">Error: Cannot find module ‘./build/Release/DTraceProviderBindings’</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#操作命令行"><span class="toc-number">3.</span> <span class="toc-text">操作命令行</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#配置文件"><span class="toc-number">3.1.</span> <span class="toc-text">配置文件</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#目录结构"><span class="toc-number">4.</span> <span class="toc-text">目录结构</span></a></li></ol>
		</div>
		
		<h2 id="学习链接"><a href="#学习链接" class="headerlink" title="学习链接"></a>学习链接</h2><p>Hexo官网 (右侧可以选择中文简体)<br><a href="http://hexo.io/" target="_blank" rel="external">http://hexo.io/</a></p>
<p>Hexo 入门<br><a href="http://zipperary.com/categories/hexo/" target="_blank" rel="external">http://zipperary.com/categories/hexo/</a></p>
<p>Hexo Admin<br><a href="http://jaredly.github.io/hexo-admin/" target="_blank" rel="external">http://jaredly.github.io/hexo-admin/</a></p>
<p>Hexo Theme wiki<br><a href="https://github.com/hexojs/hexo/wiki/Themes" target="_blank" rel="external">https://github.com/hexojs/hexo/wiki/Themes</a></p>
<p>Hexo 静态blog搜索<br><a href="https://swiftype.com/" target="_blank" rel="external">https://swiftype.com/</a></p>
<p>Hexo 插件<br><a href="http://hexo.io/plugins/" target="_blank" rel="external">http://hexo.io/plugins/</a></p>
<p>Hexo 插件wiki<br><a href="https://github.com/hexojs/hexo-generator-feed" target="_blank" rel="external">https://github.com/hexojs/hexo-generator-feed</a></p>
<h2 id="常见错误"><a href="#常见错误" class="headerlink" title="常见错误"></a>常见错误</h2><h3 id="git-deploy上传时提示仓库不存在"><a href="#git-deploy上传时提示仓库不存在" class="headerlink" title="git deploy上传时提示仓库不存在"></a>git deploy上传时提示仓库不存在</h3><pre><code>删除主目录下的.deploy_git文件
</code></pre><h3 id="Error-Cannot-find-module-‘-build-Release-DTraceProviderBindings’"><a href="#Error-Cannot-find-module-‘-build-Release-DTraceProviderBindings’" class="headerlink" title="Error: Cannot find module ‘./build/Release/DTraceProviderBindings’"></a>Error: Cannot find module ‘./build/Release/DTraceProviderBindings’</h3><pre><code>错误下面有dtrace-provider.js:17:23这一行，也就是这个文件的位置
编辑这个文件/Users/liqi/Dropbox/programs/nodejs/buildlove.github.io/node_modules/.0.7.1@dtrace-provider/dtrace-provider.js直接注释掉
</code></pre><figure class="highlight plain"><table><tr><td class="code"><pre><div class="line">// var builds = [&apos;Release&apos;, &apos;default&apos;, &apos;Debug&apos;];</div><div class="line"></div><div class="line">// for (var i in builds) &#123;</div><div class="line">//     try &#123;</div><div class="line">//         var binding = require(&apos;./build/&apos; + builds[i] + &apos;/DTraceProviderBindings&apos;);</div><div class="line">//         DTraceProvider = binding.DTraceProvider;</div><div class="line">//         break;</div><div class="line">//     &#125; catch (e) &#123;</div><div class="line">//         // if the platform looks like it _should_ have DTrace</div><div class="line">//         // available, log a failure to load the bindings.</div><div class="line">//         if (process.platform == &apos;darwin&apos; ||</div><div class="line">//             process.platform == &apos;sunos&apos; ||</div><div class="line">//             process.platform == &apos;freebsd&apos;) &#123;</div><div class="line">//             console.error(e);</div><div class="line">//         &#125;</div><div class="line">//     &#125;</div><div class="line">// &#125;</div></pre></td></tr></table></figure>
<h2 id="操作命令行"><a href="#操作命令行" class="headerlink" title="操作命令行"></a>操作命令行</h2><figure class="highlight plain"><table><tr><td class="code"><pre><div class="line">hexo new &quot;postName&quot; #新建文章</div><div class="line">hexo new page &quot;pageName&quot; #新建页面</div><div class="line">hexo generate #生成静态页面至public目录</div><div class="line">hexo server #开启预览访问端口（默认端口4000，&apos;ctrl + c&apos;关闭server）</div><div class="line">hexo deploy #将.deploy目录部署到GitHub</div><div class="line">hexo deploy -g</div><div class="line">hexo server -g</div><div class="line">hexo n == hexo new</div><div class="line">hexo g == hexo generate</div><div class="line">hexo s == hexo server</div><div class="line">hexo d == hexo deploy</div></pre></td></tr></table></figure>
<h3 id="配置文件"><a href="#配置文件" class="headerlink" title="配置文件"></a>配置文件</h3><figure class="highlight plain"><table><tr><td class="code"><pre><div class="line"># Hexo Configuration</div><div class="line">## Docs: http://hexo.io/docs/configuration.html</div><div class="line">## Source: https://github.com/hexojs/hexo/</div><div class="line"></div><div class="line"># Site</div><div class="line">title: Screenshot 2015</div><div class="line">subtitle: Stay hungry,stay foolish.</div><div class="line">description: &apos;whatever&apos;</div><div class="line">author: Screenshot 2015</div><div class="line">language: chinese</div><div class="line">email: mkdir_yang@163.com</div><div class="line">language: zh-CN</div><div class="line"># language: zh-Hans</div><div class="line"></div><div class="line"># URL</div><div class="line">## If your site is put in a subdirectory, set url as &apos;http://yoursite.com/child&apos; and root as &apos;/child/&apos;</div><div class="line">url: http://buildlove.github.io</div><div class="line">root: /</div><div class="line">permalink: :year/:month/:day/:title/</div><div class="line">permalink_defaults:</div><div class="line">tag_dir: tags</div><div class="line">archive_dir: archives</div><div class="line">category_dir: categories</div><div class="line">code_dir: downloads/code</div><div class="line"></div><div class="line"># Directory</div><div class="line">source_dir: source</div><div class="line">public_dir: public</div><div class="line">i18n_dir: :lang</div><div class="line">skip_render:</div><div class="line"></div><div class="line"># Writing</div><div class="line">new_post_name: :title.md # File name of new posts</div><div class="line">default_layout: post</div><div class="line">titlecase: false # Transform title into titlecase</div><div class="line">external_link: true # Open external links in new tab</div><div class="line">max_open_file: 100</div><div class="line">multi_thread: true</div><div class="line">filename_case: 0</div><div class="line">render_drafts: false</div><div class="line">post_asset_folder: false</div><div class="line">relative_link: false</div><div class="line">future: true</div><div class="line">highlight:</div><div class="line">  enable: true</div><div class="line">  line_number: false</div><div class="line">  # auto_detect: false</div><div class="line">  tab_replace:</div><div class="line"></div><div class="line"># Category &amp; Tag</div><div class="line">default_category: uncategorized</div><div class="line">category_map:</div><div class="line">tag_map:</div><div class="line"></div><div class="line"># Archives #存档，这里的说明好像不对。全部选择1，这个选项与主题中的选项有时候会有冲突</div><div class="line">## 2: Enable pagination</div><div class="line">## 1: Disable pagination</div><div class="line">## 0: Fully Disable</div><div class="line">archive: 1</div><div class="line">category: 1</div><div class="line">tag: 1</div><div class="line"></div><div class="line"># Server 本地服务参数</div><div class="line">## Hexo uses Connect as a server</div><div class="line">## You can customize the logger format as defined in</div><div class="line">## http://www.senchalabs.org/connect/logger.html</div><div class="line">port: 4001</div><div class="line">logger: true</div><div class="line">logger_format:</div><div class="line"></div><div class="line"># Date / Time format 日期显示格式</div><div class="line">## Hexo uses Moment.js to parse and display date</div><div class="line">## You can customize the date format as defined in</div><div class="line">## http://momentjs.com/docs/#/displaying/format/</div><div class="line">date_format: YYYY-MM-DD</div><div class="line"># date_format: MMM D YYYY</div><div class="line"># time_format: HH:mm:ss</div><div class="line">time_format: H:mm:ss</div><div class="line"></div><div class="line"># Pagination 分页设置</div><div class="line">## Set per_page to 0 to disable pagination</div><div class="line">per_page: 10</div><div class="line">pagination_dir: page</div><div class="line"></div><div class="line"># Disqus #社会化评论disqus，我使用多说，在主题中配置</div><div class="line">disqus_shortname:</div><div class="line"></div><div class="line"># Extensions 插件</div><div class="line"># Plugins: http://hexo.io/plugins/</div><div class="line"># plugins: 最新版hexo注释掉不报错</div><div class="line">#  - hexo-generator-feed</div><div class="line">#  - hexo-generator-sitemap</div><div class="line"># Themes: http://hexo.io/themes/</div><div class="line">theme: pacman</div><div class="line"># theme: next</div><div class="line"></div><div class="line"># Deployment 部署</div><div class="line">## Docs: http://hexo.io/docs/deployment.html</div><div class="line">deploy:</div><div class="line">  type: git</div><div class="line">  # repository: https://github.com/buildlove/buildlove.github.io.git</div><div class="line">  repo: https://github.com/buildlove/buildlove.github.io.git</div><div class="line">  # repository: git@github.com:buildlove/buildlove.github.io.git</div><div class="line">  # branch: gh-pages</div><div class="line">  branch: master</div><div class="line"></div><div class="line"># Others</div><div class="line">index_generator:</div><div class="line">  per_page: 5 ##首页默认10篇文章标题 如果值为0不分页</div><div class="line"></div><div class="line">archive_generator:</div><div class="line">  per_page: 0 ##归档页面默认10篇文章标题</div><div class="line">  yearly: true  ##生成年视图</div><div class="line">  monthly: true ##生成月视图</div><div class="line"></div><div class="line">tag_generator:</div><div class="line">  per_page: 0 ##标签分类页面默认10篇文章</div><div class="line"></div><div class="line">category_generator:</div><div class="line">  per_page: 0 ###分类页面默认10篇文章</div><div class="line"></div><div class="line">// rss: /atom.xml 最新版注释掉也能用</div><div class="line"></div><div class="line">sitemap:</div><div class="line">  path: sitemap.xml</div><div class="line"></div><div class="line">#sitemap</div><div class="line">baidusitemap:</div><div class="line">  path: baidusitemap.xm</div><div class="line"></div><div class="line">swift_search:</div><div class="line">  enable: true</div></pre></td></tr></table></figure>
<h2 id="目录结构"><a href="#目录结构" class="headerlink" title="目录结构"></a>目录结构</h2><figure class="highlight plain"><table><tr><td class="code"><pre><div class="line">.</div><div class="line">├── .deploy</div><div class="line">├── public</div><div class="line">├── scaffolds</div><div class="line">├── scripts</div><div class="line">├── source</div><div class="line">|   ├── _drafts</div><div class="line">|   └── _posts</div><div class="line">├── themes</div><div class="line">├── _config.yml</div><div class="line">└── package.json</div><div class="line">└── package.json</div><div class="line">.deploy：执行hexo deploy命令部署到GitHub上的内容目录</div><div class="line">public：执行hexo generate命令，输出的静态网页内容目录</div><div class="line">scaffolds：layout模板文件目录，其中的md文件可以添加编辑</div><div class="line">scripts：扩展脚本目录，这里可以自定义一些javascript脚本</div><div class="line">source：文章源码目录，该目录下的markdown和html文件均会被hexo处理。该页面对应repo的根目录，404文件、favicon.ico文件，CNAME文件等都应该放这里，该目录下可新建页面目录。</div><div class="line">_drafts：草稿文章</div><div class="line">_posts：发布文章</div><div class="line">themes：主题文件目录</div><div class="line">_config.yml：全局配置文件，大多数的设置都在这里</div><div class="line">package.json：应用程序数据，指明hexo的版本等信息，类似于一般软件中的关于按钮</div></pre></td></tr></table></figure>
  
	</div>
		<footer class="article-footer clearfix">

  <div class="article-tags">
  
  <span></span> <a href="/tags/hexo/">hexo</a>
  </div>


<div class="article-categories">
  <span></span>
  <a class="article-category-link" href="/categories/hexo学习配置/">hexo学习配置</a>
</div>



<div class="article-share" id="share">

  <div data-url="http://buildlove.github.io/2016/11/09/hexo/" data-title="hexo | liyang&#39;s blog" data-tsina="null" class="share clearfix">
  </div>

</div>
</footer>   	       
	</article>
	
<nav class="article-nav clearfix">
 

<div class="next">
<a href="/2016/10/13/mongoose/"  title="centos上配置mongodb">
 <strong>下一篇:</strong><br/> 
 <span>centos上配置mongodb
</span>
</a>
</div>

</nav>

	
<section class="comment">
	<div class="ds-thread"></div>
</section>

</div>  
      <div class="openaside"><a class="navbutton" href="#" title="Show Sidebar"></a></div>

  <div id="toc" class="toc-aside">
  <strong class="toc-title">Contents</strong>
  <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#学习链接"><span class="toc-number">1.</span> <span class="toc-text">学习链接</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#常见错误"><span class="toc-number">2.</span> <span class="toc-text">常见错误</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#git-deploy上传时提示仓库不存在"><span class="toc-number">2.1.</span> <span class="toc-text">git deploy上传时提示仓库不存在</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#Error-Cannot-find-module-‘-build-Release-DTraceProviderBindings’"><span class="toc-number">2.2.</span> <span class="toc-text">Error: Cannot find module ‘./build/Release/DTraceProviderBindings’</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#操作命令行"><span class="toc-number">3.</span> <span class="toc-text">操作命令行</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#配置文件"><span class="toc-number">3.1.</span> <span class="toc-text">配置文件</span></a></li></ol></li><li class="toc-item toc-level-2"><a class="toc-link" href="#目录结构"><span class="toc-number">4.</span> <span class="toc-text">目录结构</span></a></li></ol>
  </div>

<div id="asidepart">
<div class="closeaside"><a class="closebutton" href="#" title="Hide Sidebar"></a></div>
<aside class="clearfix">

  
<div class="categorieslist">
	<p class="asidetitle">Categories</p>
		<ul>
		
			<li><a href="/categories/database/" title="database">database<sup>1</sup></a></li>
		
			<li><a href="/categories/git-difftool-Beyond-Compare/" title="git difftool(Beyond Compare)">git difftool(Beyond Compare)<sup>1</sup></a></li>
		
			<li><a href="/categories/hexo学习配置/" title="hexo学习配置">hexo学习配置<sup>1</sup></a></li>
		
			<li><a href="/categories/javascript/" title="javascript">javascript<sup>1</sup></a></li>
		
			<li><a href="/categories/linux/" title="linux">linux<sup>1</sup></a></li>
		
			<li><a href="/categories/node-npm命令行参数和插件/" title="node&amp;npm命令行参数和插件">node&amp;npm命令行参数和插件<sup>1</sup></a></li>
		
			<li><a href="/categories/python/" title="python">python<sup>1</sup></a></li>
		
			<li><a href="/categories/七牛/" title="七牛">七牛<sup>1</sup></a></li>
		
			<li><a href="/categories/分布式版本管理工具/" title="分布式版本管理工具">分布式版本管理工具<sup>1</sup></a></li>
		
			<li><a href="/categories/数据库/" title="数据库">数据库<sup>1</sup></a></li>
		
			<li><a href="/categories/绘图/" title="绘图">绘图<sup>1</sup></a></li>
		
		</ul>
</div>


  
<div class="tagslist">
	<p class="asidetitle">Tags</p>
		<ul class="clearfix">
		
			<li><a href="/tags/database/" title="database">database<sup>2</sup></a></li>
		
			<li><a href="/tags/git/" title="git">git<sup>1</sup></a></li>
		
			<li><a href="/tags/hexo/" title="hexo">hexo<sup>1</sup></a></li>
		
			<li><a href="/tags/js/" title="js">js<sup>1</sup></a></li>
		
			<li><a href="/tags/linux/" title="linux">linux<sup>1</sup></a></li>
		
			<li><a href="/tags/mac/" title="mac">mac<sup>1</sup></a></li>
		
			<li><a href="/tags/mysql/" title="mysql">mysql<sup>1</sup></a></li>
		
			<li><a href="/tags/node/" title="node">node<sup>1</sup></a></li>
		
			<li><a href="/tags/npm/" title="npm">npm<sup>1</sup></a></li>
		
			<li><a href="/tags/photo/" title="photo">photo<sup>1</sup></a></li>
		
			<li><a href="/tags/ps/" title="ps">ps<sup>1</sup></a></li>
		
			<li><a href="/tags/python/" title="python">python<sup>2</sup></a></li>
		
			<li><a href="/tags/ubuntu/" title="ubuntu">ubuntu<sup>1</sup></a></li>
		
			<li><a href="/tags/分布式版本管理工具/" title="分布式版本管理工具">分布式版本管理工具<sup>1</sup></a></li>
		
			<li><a href="/tags/图床/" title="图床">图床<sup>1</sup></a></li>
		
		</ul>
</div>


  <div class="rsspart">
	<a href="/atom.xml" target="_blank" title="rss">RSS</a>
</div>

</aside>
</div>
    </div>
    <footer><div id="footer" >
	
	<div class="line">
		<span></span>
		<div class="author"></div>
	</div>
	
	
	<section class="info">
		<p> Hello ,I&#39;m Liyang Page in Honglian. <br/>
			This is my blog,believe it or not.</p>
	</section>
	 
	<div class="social-font clearfix">
		
		<a href="http://weibo.com/1954002307" target="_blank" title="weibo"></a>
		
		
		<a href="https://twitter.com/564845354" target="_blank" title="twitter"></a>
		
		
		<a href="https://github.com/buildlove" target="_blank" title="github"></a>
		
		
		<a href="https://www.facebook.com/profile.php?id=100008166199067" target="_blank" title="facebook"></a>
		
		
	</div>
		<p class="copyright">Powered by <a href="http://hexo.io" target="_blank" title="hexo">hexo</a> and Theme by <a href="https://github.com/A-limon/pacman" target="_blank" title="Pacman">Pacman</a> © 2017 
		
		<a href="http://buildlove.github.io" target="_blank" title="Screenshot 2015">Screenshot 2015</a>
		
		</p>
</div>
</footer>
    <script src="/js/jquery-2.1.0.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){ 
  $('.navbar').click(function(){
    $('header nav').toggleClass('shownav');
  });
  var myWidth = 0;
  function getSize(){
    if( typeof( window.innerWidth ) == 'number' ) {
      myWidth = window.innerWidth;
    } else if( document.documentElement && document.documentElement.clientWidth) {
      myWidth = document.documentElement.clientWidth;
    };
  };
  var m = $('#main'),
      a = $('#asidepart'),
      c = $('.closeaside'),
      o = $('.openaside');
  $(window).resize(function(){
    getSize(); 
    if (myWidth >= 1024) {
      $('header nav').removeClass('shownav');
    }else
    {
      m.removeClass('moveMain');
      a.css('display', 'block').removeClass('fadeOut');
      o.css('display', 'none');
      
      $('#toc.toc-aside').css('display', 'none');
        
    }
  });
  c.click(function(){
    a.addClass('fadeOut').css('display', 'none');
    o.css('display', 'block').addClass('fadeIn');
    m.addClass('moveMain');
  });
  o.click(function(){
    o.css('display', 'none').removeClass('beforeFadeIn');
    a.css('display', 'block').removeClass('fadeOut').addClass('fadeIn');      
    m.removeClass('moveMain');
  });
  $(window).scroll(function(){
    o.css("top",Math.max(80,260-$(this).scrollTop()));
  });
});
</script>

<script type="text/javascript">
$(document).ready(function(){ 
  var ai = $('.article-content>iframe'),
      ae = $('.article-content>embed'),
      t  = $('#toc'),
      h  = $('article h2')
      ah = $('article h2'),
      ta = $('#toc.toc-aside'),
      o  = $('.openaside'),
      c  = $('.closeaside');
  if(ai.length>0){
    ai.wrap('<div class="video-container" />');
  };
  if(ae.length>0){
   ae.wrap('<div class="video-container" />');
  };
  if(ah.length==0){
    t.css('display','none');
  }else{
    c.click(function(){
      ta.css('display', 'block').addClass('fadeIn');
    });
    o.click(function(){
      ta.css('display', 'none');
    });
    $(window).scroll(function(){
      ta.css("top",Math.max(140,320-$(this).scrollTop()));
    });
  };
});
</script>


<script type="text/javascript">
$(document).ready(function(){ 
  var $this = $('.share'),
      url = $this.attr('data-url'),
      encodedUrl = encodeURIComponent(url),
      title = $this.attr('data-title'),
      tsina = $this.attr('data-tsina');
  var html = [
  '<a href="#" class="overlay" id="qrcode"></a>',
  '<div class="qrcode clearfix"><span>扫描二维码分享到微信朋友圈</span><a class="qrclose" href="#share"></a><strong>Loading...Please wait</strong><img id="qrcode-pic" data-src="http://s.jiathis.com/qrcode.php?url=' + encodedUrl + '"/></div>',
  '<a href="#textlogo" class="article-back-to-top" title="Top"></a>',
  '<a href="https://www.facebook.com/sharer.php?u=' + encodedUrl + '" class="article-share-facebook" target="_blank" title="Facebook"></a>',
  '<a href="#qrcode" class="article-share-qrcode" title="QRcode"></a>',
  '<a href="https://twitter.com/intent/tweet?url=' + encodedUrl + '" class="article-share-twitter" target="_blank" title="Twitter"></a>',
  '<a href="http://service.weibo.com/share/share.php?title='+title+'&url='+encodedUrl +'&ralateUid='+ tsina +'&searchPic=true&style=number' +'" class="article-share-weibo" target="_blank" title="Weibo"></a>',
  '<span title="Share to"></span>'
  ].join('');
  $this.append(html);
  $('.article-share-qrcode').click(function(){
    var imgSrc = $('#qrcode-pic').attr('data-src');
    $('#qrcode-pic').attr('src', imgSrc);
    $('#qrcode-pic').load(function(){
        $('.qrcode strong').text(' ');
    });
  });
});     
</script>


<script type="text/javascript">
  var duoshuoQuery = {short_name:"buildlove"};
  (function() {
    var ds = document.createElement('script');
    ds.type = 'text/javascript';ds.async = true;
    ds.src = '//static.duoshuo.com/embed.js';
    ds.charset = 'UTF-8';
    (document.getElementsByTagName('head')[0] 
    || document.getElementsByTagName('body')[0]).appendChild(ds);
  })();
</script> 



<link rel="stylesheet" href="/fancybox/jquery.fancybox.css" media="screen" type="text/css">
<script src="/fancybox/jquery.fancybox.pack.js"></script>
<script type="text/javascript">
$(document).ready(function(){ 
  $('.article-content').each(function(i){
    $(this).find('img').each(function(){
      if ($(this).parent().hasClass('fancybox')) return;
      var alt = this.alt;
      if (alt) $(this).after('<span class="caption">' + alt + '</span>');
      $(this).wrap('<a href="' + this.src + '" title="' + alt + '" class="fancybox"></a>');
    });
    $(this).find('.fancybox').each(function(){
      $(this).attr('rel', 'article' + i);
    });
  });
  if($.fancybox){
    $('.fancybox').fancybox();
  }
}); 
</script>



  </body>
</html>
